import { useRouter } from 'vue-router'

export function useMenu() {
  const router = useRouter()

  const handleMenuSelect = (index) => {
    const routes = {
      'product-1': '/products/exam',
      'product-2': '/products/question-bank',
      'solution-1': '/solutions/education',
      'solution-2': '/solutions/enterprise',
      'demo': '/demo',
      'contact': '/contact',
      'api': '/api'
    }
    if (routes[index]) {
      router.push(routes[index])
    }
  }

  return {
    handleMenuSelect
  }
}
